package com.itc.system.api;


import com.itc.common.core.constant.ServiceNameConstants;
import com.itc.common.core.domain.R;
import com.itc.system.api.domain.SysDept;
import com.itc.system.api.domain.SysUser;
import com.itc.system.api.domain.dto.SysDeptCheckDto;
import com.itc.system.api.factory.RemoteSystemFallbackFactory;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * itc-system远程调用中转模块
 */

@FeignClient(value = ServiceNameConstants.SYSTEM_SERVICE,
        fallbackFactory = RemoteSystemFallbackFactory.class,contextId = "RemoteSystemService")
public interface RemoteSystemService {

    /**
     * 用户部门、席位信息校验
     * @param dto
     * @return
     */
    @PostMapping(value = "/systemFeign/bi/dept/check")
    Boolean biDeptCheck(@RequestBody SysDeptCheckDto dto);

    //根据id获取部门树行信息
    @GetMapping(value = "/systemFeign/get/deptTreeById")
     List<SysDept> getSysDeptList(@RequestParam("deptId") String deptId);

    //根据deptId获取部门信息
    @GetMapping(value = "/systemFeign/get/deptById")
    SysDept getDeptById(@RequestParam("deptId") Long deptId);

    //根据用户userId获取用户信息
    @GetMapping(value = "/systemFeign/getDept/byUserId")
    SysUser getSysUser(@RequestParam("userId") Long userId);

    //根据dept_child_ids获取多个席位信息
    @GetMapping(value = "/systemFeign/get/deptChildByIds")
    List<SysDept> getDeptChildById(@RequestParam("deptChildIds") String deptChildIds);



    //查询全部部门,包括席位
    @PostMapping(value = "/dept/tree/all")
    R<List<SysDept>> getAllDeptName(@RequestBody SysDept sysDept);


    /**
     * 根据部门席位信息查询所属席位信息,包括部门
     * @param sysDept
     * @return
     */
    @PostMapping("/dept/seat/list")
    R<List<SysDept>> getSeatListByDeptId(@RequestBody SysDeptCheckDto sysDept);


}
